cmake_minimum_required(VERSION 3.0.2)
project(service_launcher)

find_package(catkin REQUIRED COMPONENTS
  rospy
  std_msgs
  message_generation
)

add_service_files(
  FILES
  LaunchControl.srv
)

generate_messages(
  DEPENDENCIES
  std_msgs
)

catkin_package(
  CATKIN_DEPENDS rospy std_msgs message_runtime
)

include_directories(
  ${catkin_INCLUDE_DIRS}
)

catkin_install_python(PROGRAMS
  scripts/launch_manager.py
  examples/test_python_service.py
  examples/test_ros_node.py
  examples/test_launch_node.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY launch/
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)

install(DIRECTORY config/
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
)

install(DIRECTORY tests/
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/tests
)

install(FILES
  launch_all_services.sh
  launch_dual_services.sh
  kill_all_services.sh
  stop_dual_services.sh
  check_service_files.sh
  analyze_services.py
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)